home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Fonts.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  7.8 KB  |  361 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Fonts.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__FONTS__') = 'UNDEFINED' THEN
  18. __FONTS__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26. systemFont                        EQU        0
  27. applFont                        EQU        1
  28. newYork                            EQU        2
  29. geneva                            EQU        3
  30. monaco                            EQU        4
  31. venice                            EQU        5
  32. london                            EQU        6
  33. athens                            EQU        7
  34. sanFran                            EQU        8
  35. toronto                            EQU        9
  36. cairo                            EQU        11
  37. losAngeles                        EQU        12
  38. times                            EQU        20
  39. helvetica                        EQU        21
  40. courier                            EQU        22
  41. symbol                            EQU        23
  42. mobile                            EQU        24
  43. commandMark                        EQU        17
  44. checkMark                        EQU        18
  45. diamondMark                        EQU        19
  46.  
  47. appleMark                        EQU        20
  48. propFont                        EQU        36864
  49. prpFntH                            EQU        36865
  50. prpFntW                            EQU        36866
  51. prpFntHW                        EQU        36867
  52. fixedFont                        EQU        45056
  53. fxdFntH                            EQU        45057
  54. fxdFntW                            EQU        45058
  55. fxdFntHW                        EQU        45059
  56. fontWid                            EQU        44208
  57.  
  58. FMInput                 RECORD    0
  59. family                     ds.w    1
  60. size                     ds.w    1
  61. face                     ds.b    1
  62. needBits                 ds.b    1
  63. device                     ds.w    1
  64. numer                     ds        Point
  65. denom                     ds        Point
  66. sizeof                     EQU    16
  67.                         ENDR
  68.  
  69. FMOutput                 RECORD    0
  70. errNum                     ds.w    1
  71. fontHandle                 ds.l    1
  72. boldPixels                 ds.b    1
  73. italicPixels             ds.b    1
  74. ulOffset                 ds.b    1
  75. ulShadow                 ds.b    1
  76. ulThick                     ds.b    1
  77. shadowPixels             ds.b    1
  78. extra                     ds.b    1
  79. ascent                     ds.b    1
  80. descent                     ds.b    1
  81. widMax                     ds.b    1
  82. leading                     ds.b    1
  83. curStyle                 ds.b    1
  84. numer                     ds        Point
  85. denom                     ds        Point
  86. sizeof                     EQU    26
  87.                         ENDR
  88.  
  89. FontRec                 RECORD    0
  90. fontType                 ds.w    1                                    ;font type
  91. firstChar                 ds.w    1                                    ;ASCII code of first character
  92. lastChar                 ds.w    1                                    ;ASCII code of last character
  93. widMax                     ds.w    1                                    ;maximum character width
  94. kernMax                     ds.w    1                                    ;negative of maximum character kern
  95. nDescent                 ds.w    1                                    ;negative of descent
  96. fRectWidth                 ds.w    1                                    ;width of font rectangle
  97. fRectHeight                 ds.w    1                                    ;height of font rectangle
  98. owTLoc                     ds.w    1                                    ;offset to offset/width table
  99. ascent                     ds.w    1                                    ;ascent
  100. descent                     ds.w    1                                    ;descent
  101. leading                     ds.w    1                                    ;leading
  102. rowWords                 ds.w    1                                    ;row width of bit image / 2 
  103. sizeof                     EQU    26
  104.                         ENDR
  105.  
  106. FMetricRec                 RECORD    0
  107. ascent                     ds.l    1                                    ;base line to top
  108. descent                     ds.l    1                                    ;base line to bottom
  109. leading                     ds.l    1                                    ;leading between lines
  110. widMax                     ds.l    1                                    ;maximum character width
  111. wTabHandle                 ds.l    1                                    ;handle to font width table
  112. sizeof                     EQU    20
  113.                         ENDR
  114.  
  115. WidEntry                 RECORD    0
  116. widStyle                 ds.w    1                                    ;style entry applies to
  117. sizeof                     EQU    2
  118.                         ENDR
  119.  
  120. WidTable                 RECORD    0
  121. numWidths                 ds.w    1                                    ;number of entries - 1
  122. sizeof                     EQU    2
  123.                         ENDR
  124.  
  125. AsscEntry                 RECORD    0
  126. fontSize                 ds.w    1
  127. fontStyle                 ds.w    1
  128. fontID                     ds.w    1                                    ;font resource ID
  129. sizeof                     EQU    6
  130.                         ENDR
  131.  
  132. FontAssoc                 RECORD    0
  133. numAssoc                 ds.w    1                                    ;number of entries - 1
  134. sizeof                     EQU    2
  135.                         ENDR
  136.  
  137. StyleTable                 RECORD    0
  138. fontClass                 ds.w    1
  139. offset                     ds.l    1
  140. reserved                 ds.l    1
  141. indexes                     ds.b    48
  142. sizeof                     EQU    58
  143.                         ENDR
  144.  
  145. NameTable                 RECORD    0
  146. stringCount                 ds.w    1
  147. baseFontName             ds.l    64
  148. sizeof                     EQU    258
  149.                         ENDR
  150.  
  151. KernPair                 RECORD    0
  152. kernFirst                 ds.b    1                                    ;1st character of kerned pair
  153. kernSecond                 ds.b    1                                    ;2nd character of kerned pair
  154. kernWidth                 ds.w    1                                    ;kerning in 1pt fixed format
  155. sizeof                     EQU    4
  156.                         ENDR
  157.  
  158. KernEntry                 RECORD    0
  159. kernLength                 ds.w    1                                    ;length of this entry
  160. kernStyle                 ds.w    1                                    ;style the entry applies to
  161. sizeof                     EQU    4
  162.                         ENDR
  163.  
  164. KernTable                 RECORD    0
  165. numKerns                 ds.w    1                                    ;number of kerning entries
  166. sizeof                     EQU    2
  167.                         ENDR
  168.  
  169. WidthTable                 RECORD    0
  170. tabData                     ds.l    256                                ;character widths
  171. tabFont                     ds.l    1                                    ;font record used to build table
  172. sExtra                     ds.l    1                                    ;space extra used for table
  173. style                     ds.l    1                                    ;extra due to style
  174. fID                         ds.w    1                                    ;font family ID
  175. fSize                     ds.w    1                                    ;font size request
  176. face                     ds.w    1                                    ;style (face) request
  177. device                     ds.w    1                                    ;device requested
  178. inNumer                     ds        Point                                ;scale factors requested
  179. inDenom                     ds        Point                                ;scale factors requested
  180. aFID                     ds.w    1                                    ;actual font family ID for table
  181. fHand                     ds.l    1                                    ;family record used to build up table
  182. usedFam                     ds.b    1                                    ;used fixed point family widths
  183. aFace                     ds.b    1                                    ;actual face produced
  184. vOutput                     ds.w    1                                    ;vertical scale output value
  185. hOutput                     ds.w    1                                    ;horizontal scale output value
  186. vFactor                     ds.w    1                                    ;vertical scale output value
  187. hFactor                     ds.w    1                                    ;horizontal scale output value
  188. aSize                     ds.w    1                                    ;actual size of actual font used
  189. tabSize                     ds.w    1                                    ;total size of table
  190. sizeof                     EQU    1072
  191.                         ENDR
  192.  
  193. FamRec                     RECORD    0
  194. ffFlags                     ds.w    1                                    ;flags for family
  195. ffFamID                     ds.w    1                                    ;family ID number
  196. ffFirstChar                 ds.w    1                                    ;ASCII code of 1st character
  197. ffLastChar                 ds.w    1                                    ;ASCII code of last character
  198. ffAscent                 ds.w    1                                    ;maximum ascent for 1pt font
  199. ffDescent                 ds.w    1                                    ;maximum descent for 1pt font
  200. ffLeading                 ds.w    1                                    ;maximum leading for 1pt font
  201. ffWidMax                 ds.w    1                                    ;maximum widMax for 1pt font
  202. ffWTabOff                 ds.l    1                                    ;offset to width table
  203. ffKernOff                 ds.l    1                                    ;offset to kerning table
  204. ffStylOff                 ds.l    1                                    ;offset to style mapping table
  205. ffProperty                 ds.w    9                                    ;style property info
  206. ffIntl                     ds.w    2                                    ;for international use
  207. ffVersion                 ds.w    1                                    ;version number
  208. sizeof                     EQU    52
  209.                         ENDR
  210.  
  211.     IF GENERATING68K THEN
  212.         _InitFonts:    OPWORD    $A8FE
  213.     ELSE
  214.         IMPORT    InitFonts
  215.     ENDIF
  216.  
  217.     IF GENERATING68K THEN
  218.         _GetFontName:    OPWORD    $A8FF
  219.     ELSE
  220.         IMPORT    GetFontName
  221.     ENDIF
  222.  
  223.     IF GENERATING68K THEN
  224.         _GetFNum:    OPWORD    $A900
  225.     ELSE
  226.         IMPORT    GetFNum
  227.     ENDIF
  228.  
  229.     IF GENERATING68K THEN
  230.         _RealFont:    OPWORD    $A902
  231.     ELSE
  232.         IMPORT    RealFont
  233.     ENDIF
  234.  
  235.     IF GENERATING68K THEN
  236.         _SetFontLock:    OPWORD    $A903
  237.     ELSE
  238.         IMPORT    SetFontLock
  239.     ENDIF
  240.  
  241.     IF GENERATING68K THEN
  242.         _FMSwapFont:    OPWORD    $A901
  243.     ELSE
  244.         IMPORT    FMSwapFont
  245.     ENDIF
  246.  
  247.     IF GENERATING68K THEN
  248.         _SetFScaleDisable:    OPWORD    $A834
  249.     ELSE
  250.         IMPORT    SetFScaleDisable
  251.     ENDIF
  252.  
  253.     IF GENERATING68K THEN
  254.         _FontMetrics:    OPWORD    $A835
  255.     ELSE
  256.         IMPORT    FontMetrics
  257.     ENDIF
  258.  
  259.     IF GENERATING68K THEN
  260.         Macro
  261.         _GetDefFontSize
  262.             dc.w     $3EB8
  263.             dc.w     $0BA8
  264.             dc.w     $6604
  265.             dc.w     $3EBC
  266.             dc.w     $000C
  267.         EndM
  268.     ELSE
  269.         IMPORT    GetDefFontSize
  270.     ENDIF
  271.  
  272.     IF GENERATING68K THEN
  273.         Macro
  274.         _IsOutline
  275.             moveq    #0,d0
  276.             dc.w     $A854
  277.         EndM
  278.     ELSE
  279.         IMPORT    IsOutline
  280.     ENDIF
  281.  
  282.     IF GENERATING68K THEN
  283.         Macro
  284.         _SetOutlinePreferred
  285.             moveq    #1,d0
  286.             dc.w     $A854
  287.         EndM
  288.     ELSE
  289.         IMPORT    SetOutlinePreferred
  290.     ENDIF
  291.  
  292.     IF GENERATING68K THEN
  293.         Macro
  294.         _GetOutlinePreferred
  295.             moveq    #9,d0
  296.             dc.w     $A854
  297.         EndM
  298.     ELSE
  299.         IMPORT    GetOutlinePreferred
  300.     ENDIF
  301.  
  302.     IF GENERATING68K THEN
  303.         Macro
  304.         _OutlineMetrics
  305.             moveq    #8,d0
  306.             dc.w     $A854
  307.         EndM
  308.     ELSE
  309.         IMPORT    OutlineMetrics
  310.     ENDIF
  311.  
  312.     IF GENERATING68K THEN
  313.         Macro
  314.         _SetPreserveGlyph
  315.             moveq    #10,d0
  316.             dc.w     $A854
  317.         EndM
  318.     ELSE
  319.         IMPORT    SetPreserveGlyph
  320.     ENDIF
  321.  
  322.     IF GENERATING68K THEN
  323.         Macro
  324.         _GetPreserveGlyph
  325.             moveq    #11,d0
  326.             dc.w     $A854
  327.         EndM
  328.     ELSE
  329.         IMPORT    GetPreserveGlyph
  330.     ENDIF
  331.  
  332.     IF GENERATING68K THEN
  333.         Macro
  334.         _FlushFonts
  335.             moveq    #12,d0
  336.             dc.w     $A854
  337.         EndM
  338.     ELSE
  339.         IMPORT    FlushFonts
  340.     ENDIF
  341.  
  342.     IF GENERATING68K THEN
  343.         Macro
  344.         GetSysFont
  345.             move.W $0BA6,(sp)
  346.         EndM
  347.     ELSE
  348.         IMPORT    GetSysFont
  349.     ENDIF
  350.  
  351.     IF GENERATING68K THEN
  352.         Macro
  353.         GetAppFont
  354.             move.W $0984,(sp)
  355.         EndM
  356.     ELSE
  357.         IMPORT    GetAppFont
  358.     ENDIF
  359.  
  360.     ENDIF ; __FONTS__
  361.